#ifndef DVISITORSERIALIZER_H
#define DVISITORSERIALIZER_H

#include "dvisitor.h"

class DAbstractEntity;
class DClassEntity;
class DEnumEntity;
class DMethodEntity;
class DVariableEntity;

class DVisitorSerializer : public DVisitor
{
	Q_OBJECT

public:
	DVisitorSerializer(const QString& strPath, bool bSave = true, QObject *parent = 0);
	~DVisitorSerializer();

	void visit(DAbstractEntity* pEntity);
private:
	void visitClass(DClassEntity* pClass);
	void visitEnum(DEnumEntity* pEnum);
	void visitMethod(DMethodEntity* pMethod);
	void visitVariable(DVariableEntity* pVar);

	QXmlStreamWriter	m_writer;
	QFile				m_file;
};

#endif // DVISITORSERIALIZER_H
